home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
misc_pto
/
alcocer
/
read.me
< prev
Wrap
Text File
|
1988-09-29
|
4KB
|
108 lines
CALLS.M
-------
BRIEF Macro Contest,
submitted by Darío Alcocer.
(written using BRIEF version 2.1)
Have you you ever, while typing furiously at the keyboard, needed to
know what the parameter list for calling an obscure C library function,
only to become frustrated by having to leave your PC, look up the
function in your C manual, and then forget why you needed to use that
function in the first place? You could call the header file into BRIEF
(which header file it is in, anyway) and copy the funtion prototype, but
would you want to do this every time? This macro, calls.m, is designed
to make calling the C standard library functions a little easier. It
uses the BRIEF Dialog Manager package to display a neat and tiddy window,
prompting you for all the parameters you need to make a call to
the function of interest.
The following files form the complete package:
calls.m The BRIEF macro file, searches and displays
the functions in your C function file.
calls.dat Special C function file, used by calls.cm
(functions for Microsoft C, version 5.1)
mkcalls.c Source for mkcalls.exe. Used Microsoft C,
version 5.1, though it should port to any
ANSI C compiler.
mkcalls.exe Used to convert a file containing only
ANSI-standard C function prototypes to the
*.dat file format needed by calls.cm
read.me This file.
The conversion program, mkcalls.exe, reads from the standard input
and writes to the standard output. The command-line syntax is
mkcalls < infile > outfile
The conversion takes a file that looks like this:
int foo(int x, char *y)
char goo(void *ptr, unsigned b)
...
into a data file like so:
;foo;
T(1,3)="int foo():"
T(3,3)="int x"
S(3,25)=" "
T(4,3)="char *y"
S(4,25)=" "
;
2
;goo;
T(1,3)="int goo():"
T(3,3)="void *ptr"
S(3,25)=" "
T(4,3)="unsigned b"
S(4,25)=" "
;
2
The name of the output file is not critical; the c_call macro looks
for the file "calls.dat", but you can name it anything you want
(don't forget to change the #define at the top of calls.m, though).
Make sure that this file, whatever you name it, resides in you BHELP
directory, or where all the other BRIEF dialog data and menu files are.
To create an input file, copy only the funtion prototypes from each
header file (leave out #defines, typdefs, etc.), and put each fucntion
prototype on a separate line, without leaving any blank lines. Then,
use mkcalls. If you'd like to verify your results, check against
the calls.dat file to see that it is in the same basic format.
The general dat file format is as follows:
;<name of function>;
< dialog data here >
;
<number of paramters, must be less than 6>
If you have any questions, leave E-mail at this address:
Darío Alcocer
CompuServ
72411,430
Enjoy!!